package com.copm.ifm.servers.sys.client;

import com.copm.ifm.base.api.pojo.PageDTO;
import com.copm.ifm.base.api.pojo.PageVO;
import com.copm.ifm.base.basic.ServiceResponse;
import com.copm.ifm.servers.sys.dto.SysTenantAddDTO;
import com.copm.ifm.servers.sys.dto.SysTenantPageDTO;
import com.copm.ifm.servers.sys.entity.SysTenant;
import com.copm.ifm.servers.sys.vo.SysTenantVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 租户开放接口声明类
 *
 * @author tp
 * @date 2020/12/16 14:47
 */
@FeignClient(value = "sys", contextId = "sysTenantClient")
@RequestMapping("/sys-tenant")
public interface SysTenantClient {

    @PostMapping("/page")
    ServiceResponse<PageVO<SysTenantVO>> page(@RequestBody PageDTO<SysTenantPageDTO> param);

    @GetMapping("/by/id")
    ServiceResponse<SysTenantVO> getById(@RequestParam Long id);

    @PostMapping
    ServiceResponse<?> save(@RequestBody SysTenantAddDTO addDTO);

    @GetMapping("/all/supplier")
    ServiceResponse<List<SysTenant>> getListSupplier(@RequestParam Integer supplierType);
}
